package com.monster.dao;

import com.monster.domain.SysLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ISysLogDao {

    @Insert("insert into sysLog(visitTime,username,ip,url,executionTime,method)values (#{visitTime} ,#{username} ,#{ip},#{url} ,#{executionTime} ,#{method})")
    public void save(SysLog sysLog) throws Exception;

    @Select("select * from sysLog")
    @Results(value = {
            @Result(id = true,column = "id",property = "id"),
            @Result(property = "visitTime",column = "visitTime"),
            @Result(property = "username",column = "username"),
            @Result(property = "url",column = "url"),
            @Result(property = "executionTime",column = "executionTime"),
            @Result(property = "method",column = "method")
    })
    List<SysLog> findAll() throws Exception;
}
